<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>学生修改自己的密码</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<link rel="stylesheet" type="text/css" href="css/student.css">
<link rel="stylesheet" href="<%=basePath%>css/style.css" type="text/css" media="all" />


</head>

<body>
	<jsp:include page="head.jsp"></jsp:include>
	<div>
		<div id="left">
			<ul>
				<li>
					<h2>
						<a href="<%=basePath%>message.action?id=<s:property value="#session['u']" />">查看个人信息</a>
					</h2></li>
				<li>
					<h2>
						<a href="<%=basePath%>getMessage.action?id=<s:property value="#session['u']" />">修改个人信息</a>
					</h2></li>
				<li>
					<h2>
						<a href="<%=basePath%>studScore.action?id=<s:property value="#session['u']" />">查看个人成绩</a>
					</h2></li>
				<li>
					<h2>
						<a href="<%=basePath%>stu_change_password.jsp" />修改密码</a>
					</h2></li>
			</ul>
		</div>
		<div id="main">
		<!-- 修改密码 -->
			<form class="registerform" action="changepass.action?id=<s:property value="#session['u']" />" method="post">
				<table width="550px" style="table-layout:fixed;">
					<tr>
						<td class="need" style="width:10px;">*</td>
						<td style="width:100px;" align="right">输入原密码：</td>
						<td><input type="password" value="" name="password" ajaxurl="passajx.action?id=<s:property value="#session['u']" />" class="inputxt" datatype="*" errormsg="请输入原密码！" /></td>
						<td><div class="Validform_checktip"></div>
						</td>
					</tr>
					<tr>
						<td class="need" style="width:10px;">*</td>
						<td>设置新密码：</td>
						<td style="width:210px;"><input type="password" value="" name="newpassword" class="inputxt" plugin="passwordStrength" datatype="*6-18" errormsg="密码至少6个字符,最多18个字符！" /></td>
						<td>
							<div class="Validform_checktip">密码至少6个字符,最多18个字符！</div>
							<div class="passwordStrength" style="display:none;">
								<b>密码强度：</b> <span>弱</span><span>中</span><span class="last">强</span>
							</div></td>
					</tr>
					<tr>
						<td class="need">*</td>
						<td>确认密码：</td>
						<td><input type="password" value="" name="repassword" class="inputxt" recheck="newpassword" datatype="*6-18" errormsg="两次输入的密码不一致！" />
						</td>
						<td><div class="Validform_checktip"></div>
						</td>
					</tr>
					<tr></tr>
					<tr></tr>
					<tr></tr>
					<tr>
						<td class="need"></td>

						<td colspan="2" style="padding:10px 0 18px 0;"><input type="submit" value="提 交" /> <input type="reset" value="重 置" /><span id="msgdemo" style="margin-left:30px;"></span></td>
					</tr>
				</table>
			</form>

		</div>


		<hr width=100% size=5 color=#2323fe style="FILTER: alpha(opacity=100,finishopacity=0,style=3)">
	</div>
	<script type="text/javascript" src="js/jquery-1.11.1.min.js"></script>
	<script type="text/javascript" src="js/Validform_v5.3.2.js"></script>
	<script type="text/javascript" src="js/passwordStrength.min.js"></script>
	<script type="text/javascript">
		$(function() {
			//$(".registerform").Validform();  //就这一行代码！;

			$(".registerform").Validform(
					{
						tiptype : function(msg, o, cssctl) {
							//msg：提示信息;
							//o:{obj:*,type:*,curform:*}, obj指向的是当前验证的表单元素（或表单对象），type指示提示的状态，值为1、2、3、4， 1：正在检测/提交数据，2：通过验证，3：验证失败，4：提示ignore状态, curform为当前form对象;
							//cssctl:内置的提示信息样式控制函数，该函数需传入两个参数：显示提示信息的对象 和 当前提示的状态（既形参o中的type）;
							if (!o.obj.is("form")) {//验证表单元素时o.obj为该表单元素，全部验证通过提交表单时o.obj为该表单对象;
								var objtip = o.obj.parent().next().find(
										".Validform_checktip");
								cssctl(objtip, o.type);
								objtip.text(msg);
							} else {
								var objtip = o.obj.find("#msgdemo");
								cssctl(objtip, o.type);
								objtip.text(msg);
							}
						},
						usePlugin : {
							passwordstrength : {
								minLen : 6,//设置密码长度最小值，默认为0;
								maxLen : 18,//设置密码长度最大值，默认为30;
								trigger : function(obj, error) {
									//该表单元素的keyup和blur事件会触发该函数的执行;
									//obj:当前表单元素jquery对象;
									//error:所设密码是否符合验证要求，验证不能通过error为true，验证通过则为false;

									//console.log(error);
									if (error) {
										obj.parent().next().find(
												".Validform_checktip").show();
										obj.parent().next().find(
												".passwordStrength").hide();
									} else {
										obj.parent().next().find(
												".Validform_checktip").hide();
										obj.parent().next().find(
												".passwordStrength").show();
									}
								}
							}
						},
						ajaxPost : true
					});
		})
	</script>

</body>
</html>
